from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
from module_admin.annotation.pydantic_annotation import as_query

class EmployeeSalaryBase(BaseModel):
    """员工薪资基础模型"""
    employee_id: int = Field(..., description="员工ID")
    last_year_daily_wage: float = Field(..., description="去年日薪")
    current_year_daily_wage: float = Field(..., description="今年日薪")

class EmployeeSalaryModel(EmployeeSalaryBase):
    """员工薪资响应模型"""
    id: int = Field(..., description="主键ID")
    create_time: datetime = Field(..., description="创建时间")
    update_time: datetime = Field(..., description="更新时间")
    update_by: str = Field(..., description="更新者")
    del_flag: str = Field(..., description="删除标志")
    create_by: str = Field(..., description="创建者")

    class Config:
        from_attributes = True

@as_query
class EmployeeSalaryQueryModel(BaseModel):
    """员工薪资查询模型"""
    page_num: int = Field(1, alias="pageNum", description="页码")
    page_size: int = Field(10, alias="pageSize", description="每页数量")
    employee_id: Optional[int] = Field(None, alias="employeeId", description="员工ID")
    last_year_daily_wage: Optional[float] = Field(None, alias="lastYearDailyWage", description="去年日薪")
    current_year_daily_wage: Optional[float] = Field(None, alias="currentYearDailyWage", description="今年日薪")
    create_time: Optional[datetime] = Field(None, alias="createTime", description="创建时间")
    update_time: Optional[datetime] = Field(None, alias="updateTime", description="更新时间")
    update_by: Optional[str] = Field(None, alias="updateBy", description="更新者")
    del_flag: Optional[str] = Field(None, alias="delFlag", description="删除标志")
    create_by: Optional[str] = Field(None, alias="createBy", description="创建者") 